package be.vdab;

import java.util.Arrays;
import java.util.Map;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import be.vdab.aspects.Statistiek;
import be.vdab.presentation.PersoonViewer;

public class Main {
	  public static void main(String[] args) {
	    try (ClassPathXmlApplicationContext context = 
	        new ClassPathXmlApplicationContext("spring/dao.xml","spring/services.xml", "spring/presentation.xml", "spring/advice.xml")){	    	
	    	PersoonViewer persoonViewer = context.getBean(PersoonViewer.class);
	    	persoonViewer.afbeelden();
	    	System.out.println();
	    	persoonViewer.afbeelden();
	    	System.out.println();
	    	Statistiek statistiek = context.getBean(Statistiek.class);
	    	for(Map.Entry<String, Integer> entry : statistiek.getStatistiek().entrySet()){
	    		System.out.println(entry.getKey() + ':' + entry.getValue());
	    	}
	    }
	  }
} 
